Notion Functions
Notion provides a vast array of functions capable of some extremely powerful stuffs.
The table below provides description of all the functions notion provides.
#
absReturns the absolute value of a number
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(number) | number | abs(1) | null |
#
addAdds two numbers and returns their sum, or concatenates two strings.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(text,text) | text | add("text", "text") | "text" + "text" |
(number,number) | number | add(1, 1) | 1 + 1 |
#
andReturns the logical AND of its two arguments.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(checkbox,checkbox) | checkbox | and(true, true) | true and true |
#
cbrtReturns the cube root of a number.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(number) | number | cbrt(1) | null |
#
ceilReturns the smallest integer greater than or equal to a number.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(number) | number | ceil(1) | null |
#
concatConcatenates its arguments and returns the result.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(text) | text | concat("text") | null |
#
containsReturns true if the second argument is found in the first.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(text,text) | checkbox | contains("text", "text") | null |
#
dateReturns an integer number, between 1 and 31, corresponding to day of the month for the given.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(date) | number | date(now()) | null |
#
dateAddAdd to a date. The last argument, unit, can be one of: "years", "quarters", "months", "weeks", "days", "hours", "minutes", "seconds", or "milliseconds".
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(date,number,text) | date | dateAdd(now(), 1, "seconds") | null |
#
dateBetweenReturns the time between two dates. The last argument, unit, can be one of: "years", "quarters", "months", "weeks", "days", "hours", "minutes", "seconds", or "milliseconds".
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(date,date,text) | number | dateBetween(now(), now(), "seconds") | null |
#
dateSubtractSubtract from a date. The last argument, unit, can be one of: "years", "quarters", "months", "weeks", "days", "hours", "minutes", "seconds", or "milliseconds".
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(date,number,text) | date | dateSubtract(now(), 1, "seconds") | null |
#
dayReturns an integer number corresponding to the day of the week for the given date: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(date) | number | day(now()) | null |
#
divideDivides two numbers and returns their quotient.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(number,number) | number | divide(1, 1) | 1 / 1 |
#
emptyTests if a value is empty.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(text) | checkbox | empty("text") | null |
(number) | checkbox | empty(1) | null |
(checkbox) | checkbox | empty(true) | null |
(date) | checkbox | empty(now()) | null |
#
endReturns the end of a date range.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(date) | date | end(now()) | null |
#
equalReturns true if its arguments are equal, and false otherwise.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(number,number) | checkbox | equal(1, 1) | 1 == 1 |
(text,text) | checkbox | equal("text", "text") | "text" == "text" |
(checkbox,checkbox) | checkbox | equal(true, true) | true == true |
(date,date) | checkbox | equal(now(), now()) | now() == now() |
#
expReturns E^x, where x is the argument, and E is Euler's constant (2.718…), the base of the natural logarithm.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(number) | number | exp(1) | null |
#
floorReturns the largest integer less than or equal to a number.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(number) | number | floor(1) | null |
#
formatFormats its argument as a string.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(text) | text | format("text") | null |
(date) | text | format(now()) | null |
(number) | text | format(1) | null |
(checkbox) | text | format(true) | null |
#
formatDateFormat a date using the Moment standard time format string.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(date,text) | text | formatDate(now(), "text") | null |
#
fromTimestampReturns a date constructed from a Unix millisecond timestamp, corresponding to the number of milliseconds since January 1, 1970.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(number) | date | fromTimestamp(1) | null |
#
hourReturns an integer number, between 0 and 23, corresponding to hour for the given date.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(date) | number | hour(now()) | null |
#
ifSwitches between two options based on another value.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(checkbox,number,number) | number | if(true, 1, 1) | null |
(checkbox,text,text) | text | if(true, "text", "text") | null |
(checkbox,checkbox,checkbox) | checkbox | if(true, true, true) | null |
(checkbox,date,date) | date | if(true, now(), now()) | null |
#
joinInserts the first argument between the rest and returns their concatenation.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(text) | text | join("text") | null |
#
largerReturns true if the first argument is larger than the second.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(number,number) | checkbox | larger(1, 1) | 1 > 1 |
(text,text) | checkbox | larger("text", "text") | "text" > "text" |
(checkbox,checkbox) | checkbox | larger(true, true) | true > true |
(date,date) | checkbox | larger(now(), now()) | now() > now() |
#
largerEqReturns true if the first argument is larger than or equal to than the second.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(number,number) | checkbox | largerEq(1, 1) | 1 >= 1 |
(text,text) | checkbox | largerEq("text", "text") | "text" >= "text" |
(checkbox,checkbox) | checkbox | largerEq(true, true) | true >= true |
(date,date) | checkbox | largerEq(now(), now()) | now() >= now() |
#
lengthReturns the length of a string.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(text) | number | length("text") | null |
#
lnReturns the natural logarithm of a number.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(number) | number | ln(1) | null |
#
log10Returns the base 10 logarithm of a number.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(number) | number | log10(1) | null |
#
log2Returns the base 2 logarithm of a number.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(number) | number | log2(1) | null |
#
maxReturns the largest of zero or more numbers.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(number) | number | max(1) | null |
#
minReturns the smallest of zero or more numbers.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(number) | number | min(1) | null |
#
minuteReturns an integer number, between 0 and 59, corresponding to minutes in the given date.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(date) | number | minute(now()) | null |
#
modDivides two numbers and returns their remainder.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(number,number) | number | mod(1, 1) | 1 % 1 |
#
monthReturns an integer number, between 0 and 11, corresponding to month in the given date according to local time. 0 corresponds to January, 1 to February, and so on.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(date) | number | month(now()) | null |
#
multiplyMultiplies two numbers and returns their product.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(number,number) | number | multiply(1, 1) | 1 * 1 |
#
notReturns the logical NOT of its argument.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(checkbox) | checkbox | not(true) | not true |
#
nowReturns the current date and time.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
() | date | now() | null |
#
orReturns the logical OR of its two arguments.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(checkbox,checkbox) | checkbox | or(true, true) | true or true |
#
powReturns base to the exponent power, that is, baseexponent.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(number,number) | number | pow(1, 1) | 1 ^ 1 |
#
replaceReplaces the first match of a regular expression with a new value.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(text,text,text) | text | replace("text", "text", "text") | null |
(number,text,text) | text | replace(1, "text", "text") | null |
(checkbox,text,text) | text | replace(true, "text", "text") | null |
#
replaceAllReplaces all matches of a regular expression with a new value.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(text,text,text) | text | replaceAll("text", "text", "text") | null |
(number,text,text) | text | replaceAll(1, "text", "text") | null |
(checkbox,text,text) | text | replaceAll(true, "text", "text") | null |
#
roundReturns the value of a number rounded to the nearest integer.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(number) | number | round(1) | null |
#
signReturns the sign of the x, indicating whether x is positive, negative or zero.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(number) | number | sign(1) | null |
#
sliceExtracts a substring from a string from the start index (inclusively) to the end index (optional and exclusively).
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(text,number) | text | slice("text", 1) | null |
(text,number,number) | text | slice("text", 1, 1) | null |
#
smallerReturns true if the first argument is smaller than the second.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(number,number) | checkbox | smaller(1, 1) | 1 < 1 |
(text,text) | checkbox | smaller("text", "text") | "text" < "text" |
(checkbox,checkbox) | checkbox | smaller(true, true) | true < true |
(date,date) | checkbox | smaller(now(), now()) | now() < now() |
#
smallerEqReturns true if the first argument is smaller than or equal to than the second.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(number,number) | checkbox | smallerEq(1, 1) | 1 <= 1 |
(text,text) | checkbox | smallerEq("text", "text") | "text" <= "text" |
(checkbox,checkbox) | checkbox | smallerEq(true, true) | true <= true |
(date,date) | checkbox | smallerEq(now(), now()) | now() <= now() |
#
sqrtReturns the positive square root of a number.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(number) | number | sqrt(1) | null |
#
startReturns the start of a date range.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(date) | date | start(now()) | null |
#
subtractSubtracts two numbers and returns their difference.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(number,number) | number | subtract(1, 1) | 1 - 1 |
#
testTests if a string matches a regular expression.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(text,text) | checkbox | test("text", "text") | null |
(number,text) | checkbox | test(1, "text") | null |
(checkbox,text) | checkbox | test(true, "text") | null |
#
timestampReturns an integer number from a Unix millisecond timestamp, corresponding to the number of milliseconds since January 1, 1970.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(date) | number | timestamp(now()) | null |
#
toNumberParses a number from text.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(text) | number | toNumber("text") | null |
(date) | number | toNumber(now()) | null |
(number) | number | toNumber(1) | null |
(checkbox) | number | toNumber(true) | null |
#
unaryMinusNegates a number.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(number) | number | unaryMinus(1) | - 1 |
#
unaryPlusConverts its argument into a number.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(checkbox) | number | unaryPlus(true) | + true |
(text) | number | unaryPlus("text") | + "text" |
(number) | number | unaryPlus(1) | + 1 |
#
unequalReturns false if its arguments are equal, and true otherwise.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(number,number) | checkbox | unequal(1, 1) | 1 != 1 |
(text,text) | checkbox | unequal("text", "text") | "text" != "text" |
(checkbox,checkbox) | checkbox | unequal(true, true) | true != true |
(date,date) | checkbox | unequal(now(), now()) | now() != now() |
#
yearReturns a number corresponding to the year of the given date.
Arity | Result type | Example (Function) | Example (Operator) |
---|---|---|---|
(date) | number | year(now()) | null |